{% extends "base_wiki.html" %}
{% block title %}List{% endblock %}
{% block content %}
<h1>Welcome to the Initki</h2>
{% if user.username %}
<p>{{ user.username }} Hello.<br/>
    <a href="/logout/">logout</a>
</p>
{% if pages %}
<ul>
    <table border="1">
        <tr>
            <th>Number</th>
            <th>Title</th>
            <th>Author</th>
            <th>Update Date</th>
        </tr>
        {% for page in pages %}
        <tr>
            <td align="center" >{{    forloop.counter    }}</td>
            <td>
                <a href="/view/{{ page.title }}/">{{    page.title    }}</a>
            </td>
            <td>{{ page.author }}</td>
            <td>{{ page.update_date }}</td>
            <td>
                <a href = "/edit/{{ page.title }}/"> Edit </a>
            </td>
        </tr>
        {% endfor %}
    </table>
</ul>
{% else %}
Page Not found!<br/>
{% endif %}
<a href="/edit/">new page</a>
{% else %}
<p>
    Hello. sign in Please <br/>
    <a href="/login/">login</a>
</p>
{% endif %}
{% endblock %}
